home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 8 / Eagles_Nest_Mac_Collection_Disc_8.TOAST / Developer Environments / ProGraph251 / ProGraph v2.5 / Super System Classes I / Floating Windows ƒ / Floating Windows.ReadMe < prev   
Encoding:
Text File  |  1991-10-15  |  4.0 KB  |  61 lines  |  [TEXT/ttxt]

  1. Example:      Floating Windows
  2. Written by:  Garth Smedley, TGS Systems
  3. Contents:     Floating Windows.pgs
  4.                                Floating Window XPrims
  5.                                Floating Window XPrims Library
  6.                    Floating Windows.ReadMe
  7.  
  8. Needs Prograph Extensions:
  9.                     Math Primitives
  10.                     TGS Primitives #1
  11.                     TGS Primitives #2
  12.                     Floating Window XPrims
  13.                     Basic Toolbox
  14.                     
  15.  
  16. Needs Libraries to Compile:
  17.                     Floating Window XPrims Library
  18.                     SCLibrary
  19.                     Library
  20.  
  21. Standard Methods That Were Modified:
  22.                    Universal Initial
  23.                    Application/Notify
  24.                    Application/Mouse Down
  25.                   Menu/Quit
  26.  
  27. New Classes:
  28.                   Regular Window
  29.                   Floating Window                
  30.                   Pallette
  31.                   Test Pallette
  32.                   Test Window
  33.  
  34. Description
  35. -----------
  36. An example file with a special set of primitives that allows the use of "floating windows" in your Prograph program.  Floating windows stay in front of all other active windows.  A Palette class provides code for subdividing a window into a series of rectangles that invert when selected and remembers the last selection.
  37.  
  38. How to Use in Your Program
  39. -------------------------    
  40. The classes "Floating Window", "Regular Window" and "Modal Window" have methods which keep floating windows afloat. Selectively load these classes into your file or use the example file as a starting point for your application. If you are adding floating windows to an existing file you will also have to selectively load "Application/Notify", "Application/Mouse Down", "Application/front" and "Menu/Quit". "Notify" and "Mouse Down" are changed to call "/front" instead of getting "front" directly, "front" is a get method and "Quit" has been changed to close all windows.
  41.  
  42. There are some rules you must follow in order to keep floating windows on top. All of your windows must be of class "Floating Window", "Regular Window" or "Modal Window" or a subclass of one of these. You must use the "/Open" and "/Close" methods to open and close windows; setting "active?" directly is not allowed. Because of this, you can't keep windows in the Application's active list since Prograph automatically sets "active?". Also, do not get or set the "front" attribute of Application directly; use "/front" to get the front window and "Regular Window/Bring To Front" to bring a window to the front.
  43.  
  44. To get a floating window with the title bar on the left, change the "def ID" attribute of your window from 3200 to 3202. To add or remove the close box set the "close?" attribute to TRUE or FALSE.
  45.  
  46. The example includes a class "Palette", a subclass of "Picture". Palette has two extra attributes, a list of rectangles and the currently selected rectangle. "Palette" selects a rectangle when its clicked in, and keeps the selected rectangle inverted. The classes "Test Window" and "Test Palette" demonstrate the use of "Palette" and floating windows.
  47.  
  48.  
  49. More Details
  50. ------------
  51. This example uses a set of external primitives (XPrims) to fool the Macintosh Window Manager into making windows float. The XPrims mirror normal window manager calls, they all start with "FW" usually followed by the name of the corresponding window manager routine. 
  52.  
  53. FWSelectWindow - Replaces SelectWindow.
  54. FWDragWindow - Replaces DragWindow.
  55. FWHideWindow - Replaces HideWindow.
  56. FWShowWindow - Replaces ShowWindow.
  57. FWScanWindows - Returns front floater, bottom floater and front regular. Replaces FrontWindow.
  58. FWHiliteAll - Floating windows usually stay hilited, except when the application is suspended or a modal dialog is opened. Unhilites all floaters.
  59. FWOpenWindow - Allocates a window record and opens the window items.
  60.  
  61. A window definition function, (WDEF), is used to draw the title bar of the floating window. This WDEF is kept in the resource forks of the XPrim and XPrim library files and is automatically added to your application.